home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / test / warn.g < prev   
Encoding:
Text File  |  1993-05-22  |  2.4 KB  |  102 lines  |  [TEXT/R*ch]

  1. ;;; This file should tweak all the warnings in the kernel,
  2. ;;; but not cause any fatal errors.
  3.  
  4. (game-module "not-the-file-name"
  5.   (program-version "0.0")
  6. )
  7.  
  8. ;;; Warn about attempted modification of a constant.
  9.  
  10. (set true false)
  11.  
  12. ;;; Warn about an undefined table.
  13.  
  14. (table foo)
  15.  
  16. ;;; Warn about too long of a string.
  17.  
  18. (define str2 "
  19. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  20. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  21. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  22. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  23. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  24. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  25. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  26. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  27. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  28. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  29. 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
  30. ")
  31.  
  32. (print str2)
  33.  
  34. ;;; Nonsensical top-level forms.
  35.  
  36. 12345
  37.  
  38. (burp)
  39.  
  40. ;;; Including non-modules.
  41.  
  42. (include)
  43.  
  44. (include 0)
  45.  
  46. ;;; The following definitions give us some types to work with,
  47. ;;; they also preventing Xconq from erroring out completely.
  48.  
  49. (unit-type u1)
  50. (unit-type u2)
  51. (unit-type u3)
  52.  
  53. (terrain-type t1)
  54. (terrain-type t2)
  55.  
  56. ;;; Warn about non-matching lists.
  57.  
  58. (add u* speed (0 100))
  59.  
  60. ;;; Warn about trying to fill an empty list.
  61.  
  62. (define xxx nil)
  63.  
  64. (add xxx speed nil)
  65.  
  66. ;;; Warn about incorrect table fill-in.
  67.  
  68. (table acp-to-research
  69.   (u* (u1 u2) (1 2 3 4 5 6))
  70.   )
  71.  
  72. (table acp-to-toolup
  73.   (u* (u1 u2) ((1 2) (3 4) (5 6)))
  74.   )
  75.  
  76. (table acp-to-create ("string" 56 89))
  77.  
  78. (table acp-to-create (-3 56 89))
  79.  
  80. (table acp-to-create (u1 -3 89))
  81.  
  82. (table acp-to-create (u1 u2 "foo"))
  83.  
  84. ;;; Warn about setting a non-symbol.
  85.  
  86. (set 0 2)
  87.  
  88. ;;; Warn about overwriting an existing definition.
  89.  
  90. (define u1 u2)
  91.  
  92. (set synthesis-methods nil)
  93.  
  94. (area 10 5 (terrain
  95.   "10a"
  96.   "10b"
  97.   "4a2c4b"
  98.   "10b"
  99.   "10a"
  100. ))
  101.  
  102.